<%@ page language="java" isELIgnored="false" import="java.util.*,dao.*,entity.*" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"
 %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'students.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<style type="text/css">
	table tr:nth-child(even){
		background-color: darkgray;
	}
	</style>
  </head>
  
  <body>
<%@include file="/checkLogin.jsp" %>
  <h1>学生列表</h1>
  <p>
  <form action="studentServlet">
   <input name="name" value="${param.name}" placeholder="姓名"/>
   <input name="tele" value="${param.tele}" placeholder="电话"/>
   <input name="qq" value="${param.qq}" placeholder="QQ"/>
   <input type="submit" value="查询"/>
   </form>
  </p>
     <a href="addStuServlet">增加新学员</a>
     <table border="1" align="center" width="100%" cellpadding="0" cellspacing="0">
     	<tr>
     	<td>学号</td><td>姓名</td><td>手机号</td><td>年级</td><td>QQ</td><td>删除</td>
     	</tr>
     	 <c:forEach items="${list}" var="s">
     	 <tr>
     	<td>${s.stuno}</td><td>${s.sname}</td><td>${s.telephone}</td><td>${s.gradeId}</td><td>${s.qq}</td>
     	<td>
     	<a href="8-28/stus/delStudent.jsp?stuno=${s.stuno}" onclick="return confirm('真的要删除？');">删除</a>
     	<a href="8-28/stus/updateStudent.jsp?stuno=${s.stuno}">修改</a>
     	<a href="showStudent?stuno=${s.stuno}">查看详细信息</a>
     	
     	</td>
     	</tr>  
      </c:forEach>
     </table>
     <p align="center">
     <a href="studentServlet?p=1&name=${param.name}&tele=${param.tele}&qq=${param.qq}">首页</a>
     
       <a href="studentServlet?p=${pageNo-1}&name=${param.name}&tele=${param.tele}&qq=${param.qq}">上一页</a>
     
      <span>${pageNo}</span>
      
       <a href="studentServlet?p=${pageNo+1}&name=${param.name}&tele=${param.tele}&qq=${param.qq}">下一页</a>
      
       <a href="studentServlet?p=${totalPages}&name=${param.name}&tele=${param.tele}&qq=${param.qq}">最后一页</a>
     </p>
     <!-- <div>
     <a href="reg.jsp">上次的案例</a>
      <img src="images/yuenan.jpg"/>
     </div> -->
  </body>
</html>
